//	Holds utility macros and Helper functions
#pragma once

#include "../headers/StdAfx.h"

//	Macro to safely Release COM Objects.
#ifndef SAFE_RELEASE
	#define SAFE_RELEASE(p)			if (p) { p->Release(); p = NULL; }
#endif

//	Macro to safely delete pointers.
#ifndef SAFE_DELETE
	#define SAFE_DELETE(p)			if (p) { delete p; p = NULL; }
#endif

//	Macro to safely delete array pointers.
#ifndef SAFE_DELETE_ARRAY
	#define SAFE_DELETE_ARRAY(p)	if (p) { delete [] p; p = NULL; }
#endif

//	Macro for reporting Wrapper errors
#ifndef DXERROR
	#define DXERROR(a)	{ OutputDebugString(a); OutputDebugString("\n"); return false; }
#endif

#define MAGENTA	0xFFFF00FF
#define YELLOW  0xFFFFFF00
#define RED		0xFFFF0000
#define BLUE	0xFF0000FF
#define GREEN	0xFF00FF00
#define PURPLE	0xFFFF00FF
#define WHITE	0xFFFFFFFF
#define GRAY	0xFF888888
#define CYAN	0xff00ffff


#define MAGENTA_ALPHAD	0x66FF00FF
#define YELLOW_ALPHAD	0x66FFFF00
#define RED_ALPHAD		0x66FF0000
#define BLUE_ALPHAD		0x660000FF
#define GREEN_ALPHAD	0x6600FF00
#define PURPLE_ALPHAD	0x66FF00FF


#if _DEBUG
using std::cout;
	#define COUT(x) std::cout << x
#else
	#define COUT(x) ;
#endif

// Helper function to convert a value into a string
// TODO: Convert to a template helper so we can use values other than a float
//       eg. int, long, etc.
string valueToString(float value);

// Helper function to concat strings made of char*'s
string concatchars(const char* stringA, const char* stringB);
